#include "pebble_os.h"
#include "pebble_app.h"
#include "command.h"

uint8_t data[56];

static void send_cmd(uint8_t key_cmd, const char *cmd, uint8_t key_value, const uint8_t value){
	Tuplet cname = TupletCString(key_cmd, cmd);
	Tuplet cvalue = TupletInteger(key_value, value);

	DictionaryIterator *iter;
	app_message_out_get(&iter);

	if (iter == NULL)
		return;

	dict_write_tuplet(iter, &cname);
	dict_write_tuplet(iter, &cvalue);
	dict_write_end(iter);

	app_message_out_send();
	app_message_out_release();
}

void send_camera_cmd(const char *cmd, const uint8_t value){
	send_cmd(PEBBLE_CAMERA_CMD_NAME_KEY,cmd,PEBBLE_CMD_VALUE_KEY,value);
}

void send_bacpac_cmd(const char *cmd, const uint8_t value){
	send_cmd(PEBBLE_BACPAC_CMD_NAME_KEY,cmd,PEBBLE_CMD_VALUE_KEY,value);
}
